package jp.fsoriented.toishi.util;

import android.app.Activity;
import android.content.DialogInterface;

/**
 * ダイアログを閉じるとアクティビティも閉じる
 * 
 * @author LapisCactus
 * 
 */
public class DialogCloseListener implements DialogInterface.OnClickListener {

	/** 閉じるアクティビティ */
	private Activity act;

	public DialogCloseListener(Activity act) {
		this.act = act;
	}

	@Override
	public void onClick(DialogInterface dialog, int which) {
		if (act != null) {
			act.finish();
			act = null;
		}
	}

}
